package com.best.oasis.settlement.dao.security;

import java.util.List;

import org.springframework.security.userdetails.UserDetails;
import org.springframework.security.userdetails.UsernameNotFoundException;

import com.best.oasis.settlement.common.entity.security.User;
import com.best.oasis.settlement.common.entity.security.UserGroupMapping;
import com.best.oasis.settlement.common.entity.security.UserRoleMapping;
import com.best.oasis.settlement.common.vo.security.UserVO;
import com.best.oasis.settlement.dao.base.BaseDao;

public interface UserDao  extends BaseDao<User, Long>{
	/**
	 * load user info from best logistics ldap server
	 * @param username
	 * @return
	 * @throws Exception 
	 */
	public User getUserInfoFromLdapServer(String username) throws Exception;
	/**
	 *  从LdapServer获得所有员工用户信息
	 *
	 */
	//public List<User> getAllCompanyEmployeeInfoFromLdapServer();
	public User getUserByUsername(String username);
	
	public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException ;
	public List<User> getUsersByRoleGroupId(Long roleGroupId) ;
	
    /**
     * 删除某些User_Role
     */
    public void removeUserRole(Long userid);
    /**
     * 新建User_Role
     * @param object
     * @return
     */
    public void createUserRole(UserRoleMapping object) ;
    
    public List<UserRoleMapping> getUserRoleByUserID(Long userid);
    
    /**
     * 删除某些User_Group
     */
    public void removeUserGroup(Long userid);
    /**
     * 新建User_Group
     * @param object
     * @return
     */
    public void createUserGroup(UserGroupMapping object) ;
    
    public List<UserGroupMapping> getUserGroupByUserID(Long userid);
    
    /**
	 * 根据groupId删除CRM_USER_ROLE的记录
	 * @param groupId
	 */
    public void removeUserRoleByRoleGroupId(Long groupId);
    /**
	 * 根据groupId删除CRM_USER_ROLEGROUP的记录
	 * @param groupId
	 */
    public void removeUserGroupByGroupId(Long groupId);
}
